<template>
    <van-grid :border="false">
        <van-grid-item icon="photo-o" v-for="(item, index) in hotcate" class="item" url="https://www.baidu.com"
            :key="index">
            <img :src="item.img" referrerpolicy="no-referrer"/>
            <span>{{ item.title }}</span>
        </van-grid-item>
    </van-grid>

</template>


<script setup lang='ts'>
import { ref, onMounted } from 'vue';
import { getHotcats } from '../../../api/listApi';
const hotcate = ref([] as Hotcat[]);
onMounted(async () => {
    const res = await getHotcats()
    hotcate.value = res.data
    console.log(hotcate.value)
})
</script>


<style lang='scss' scoped>
.item {
    img {
        width: 60px;
        border-radius: 5px;
    }

    &:last-child {
        .van-icon {
            display: none;
        }
    }
}
</style>